<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head th:replace="public/temp :: CSS(~{::title},~{::style})">
  <title>详细内容</title>
  <style>
    /* 弹窗的问题 */
    .popWindows {
      width: 95%;
      margin: 5% auto;
      background-color: #f3f3f3;
      overflow: hidden;
      overflow-y: scroll;
    }
    .syy{
      border: 1px solid white;
      color: white;
      padding: 10px;
      margin: 5%;
    }
    .content{
      width: 95%;
      margin: 5% auto;
    }
    .content ul{
      margin-left: 2%;
      color: black;
      font-size: 18px;
    }
    .content ul li{
      padding: 1% 0;
    }
    .content ul li>span{
      font-weight: bold;
    }
    .contentLi{
      width: 100%;
      height: 40vh;
      border-bottom: 1px solid;
      border-right: 1px solid;
      overflow: hidden;
      overflow-y: scroll;
    }
    .loginOut{
      width: 35%;
      padding: 5px;
      border: 1px solid black;
      color: black;
      text-align: center;
      border-radius: 15px;
      margin:5% auto;
    }
    .loginOut:hover{
      background-color: black;
      color: white;
      cursor: pointer;
    }
  </style>
</head>

<body>
<!--JQuery-->
<script src="/assets/js/jquery-3.6.0.min.js"></script>
<a class="syy" href="#" onclick="history.go(-1);">返回上页</a>
<!-- 弹窗 -->
<div class="popWindows">
  <div class="content">
    <ul>
      <li>
        <span>姓名:</span>
        [[${register.getName()}]]
      </li>
      <li>
        <span>性别:</span>
        [[${register.getSex()}==1?'男':'女']]
      </li>
      <li>
        <span>学号:</span>
        [[${register.getStudentId()}]]
      </li>
      <li>
        <span>手机号:</span>
        [[${register.getPhone()}]]
      </li>
      <li>
        <span>专业:</span>
        [[${register.getMajor()}]]
      </li>
      <li>
        <span>学院:</span>
        [[${register.getDepartment()}]]
      </li>
      <li class="contentLi">
        <span>自我介绍:</span>
        [[${register.getIntroduce()}]]
      </li>
      <li>
        <span>是否确认:</span>
        [[${register.getConfirm()}==0?'否':'是']]
      </li>
    </ul>
    <div class="loginOut" th:if="${register.getConfirm()} ne 1" th:onclick="'confirmReg('+${register.getId()}+')'">立即确认</div>
  </div>
</div>
<script>
  function confirmReg(id) {
    if(confirm("是否确认?")){
      $().getConfirm(id);
    }
    //调用方式
  }

  $(function () {
    $.fn.getConfirm= function (id) {
      $.post("/index/post/detail?id="+id,function(res){
        alert(res?"确认成功":"确认失败");
        if(res){
          location.reload()
        }
      });
    }
  })
</script>
</body>
</html>